package com.yc.baseapi;

public class TestByte {
	
	public void m1() {
		byte[] bytes = new byte[10];
        bytes[0]= 65;
        System.out.println(bytes[0]);
        int result = bytes[0] & 0xff;
        System.out.println(result);
	}
	
	public void m2() {
		byte[] bytes = new byte[10];
        bytes[0]= -127;
        System.out.println(bytes[0]);
        int result = bytes[0] & 0xff;
        System.out.println(result);
	}
	

	public byte[] int2bytes(int value){
	    byte[] src = new byte[4];
	    src[0] = (byte) ((value >> 24) & 0xFF); 
	    src[1] = (byte) ((value >> 16) & 0xFF);
	    src[2] = (byte) ((value >> 8) & 0xFF);
	    src[3] = (byte) (value & 0xFF);
	    return src;
	}
	
	 public byte[] toBytes(int number){
	        byte[] bytes = new byte[4];
	        bytes[3] = (byte)number;
	        bytes[2] = (byte) (number >> 8);
	        bytes[1] = (byte) (number >> 16);
	        bytes[0] = (byte) (number >> 24);
	        return bytes;
	 }
	 
	 public void m3(){
		 int b=233;//正整数强转
		 System.out.println((byte)b);
	 }
	 
	 //大——>小
	 public void qz_int2byte_233() {
		 int b=233;//正整数强转
		 System.out.println((byte)b);
	 }
	 
	 public void qz_int2byte_128() {
		 int b=128;//正整数强转
		 System.out.println((byte)b);
	 }
	 
	 public void qz_int2byte_384() {
		 int b=384;//正整数强转
		 System.out.println((byte)b);
	 }
	 
	 //小——>大
	 public void qz_byte2int() {
		 
	 }

	 public void testInt() {
		int a = 0;
		int b = 8;
		Long c = 100000000000L;
		Long d = c / b;
//		System.out.println(a & b);
		System.out.println(d);
	 }
	 

	public static void main(String[] args) {
		TestByte tb = new TestByte();
//		tb.m1();
//		tb.m2();
//		tb.int2bytes(128);
//		tb.toBytes(128);
//		tb.m3();
//		tb.qz_int2byte_128();
//		tb.qz_int2byte_384();
		tb.testInt();

	}

}
